<?php

namespace app\modules\index\services;

use app\common\services\BaseService;
use app\models\Advert;

class AdvertService extends BaseService{

    /**
     * 搜索
     * @param $place
     * @return array|\yii\db\ActiveRecord[]
     */
    public static function search($place){
        return Advert::find()
            ->asArray(true)
            ->select(['banner','uri','direct_type'])
            ->andWhere(['place'=>$place])
            ->andWhere(['is_show'=>2])
            ->orderBy(['sort'=>SORT_ASC])
            ->all();
    }
}